package admin;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;
import org.json.simple.JSONArray;

import Managers.PartidosManager;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.opensymphony.xwork2.ActionSupport;

public class PartidosJSONAction extends ActionSupport {
	
	private String partidos;
	
	@Override
	public String execute() throws Exception {
		HttpServletRequest servletRequest = ServletActionContext.getRequest();
		Gson gson = new GsonBuilder().disableHtmlEscaping().create();
		PartidosManager pm = new PartidosManager();
		
		partidos = gson.toJson(pm.obtenerPartidos());
		
		return SUCCESS;
	}

	public String getPartidos() {
		return partidos;
	}
	
	
	

}
